import { request, uploadFile } from '../utils/request.js'

export const userApi = {
  // 登录接口
  login(data) {
    return request({
      url: '/wx/login',
      method: 'POST',
      data: {
        code: data.code,
        phoneCode: data.phoneCode
      }
    })
  },
  
  // 上传用户头像
  uploadAvatar(filePath) {
    return uploadFile({
      url: '/wx/upload-avatar',
      filePath: filePath
    })
  },

  // 注册接口
  register(data) {
    return request({
      url: '/wx/register',
      method: 'POST',
      data: {
        code: data.code,
        phoneCode: data.phoneCode
      }
    })
  },

  // 更新用户资料
  updateProfile(data) {
    return request({
      url: '/wx/update-profile',
      method: 'POST',
      data: data
    })
  },

  // 提交反馈
  submitFeedback(data) {
    return request({
      url: '/wx/feedback',
      method: 'POST',
      data: data
    })
  }
} 